#ifndef file_system_h
#define file_system_h

#include <string>
#include <vector>
#include <time.h>
#include "xml.h"

using namespace std;

struct FileInfo
{
	string      name;
	long    size;
	string      type;
	string		time_write;
	string      path;
};

class CFileSystem
{
public:
	string XMLPath;
public:
	CFileSystem(void);
	bool Open(string XMLPath);
	vector<FileInfo> GetFolderInfo(string FolderInfo);
	FileInfo GetFile(string FilePath);
	bool DeleteFile(FileInfo fileInfo);
	bool DeleteFile(vector<FileInfo> FilesInfo);
	bool AddFile(FileInfo fileInfo);
	bool AddFile(vector<FileInfo> FilesInfo);
	bool IsPathExist(string Path);
private:
	XMLNode MainNode;
	XMLNode GetNode(string Path);
	XMLNode CreatePath(FileInfo fileInfo);
	string FormatTime(time_t time);
};

#endif